package com.qf.petmall.starter.ex;


import com.qf.petmall.starter.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: 可乐
 * @Description:
 * @CreateTime: 2022-11-04  09:20
 */
@RestControllerAdvice
public class GlobalExHandler {

	@ExceptionHandler(QFException.class)
	public R handQfEx(QFException e){
		e.printStackTrace();
		return R.error( e.getMsg());
	}

	@ExceptionHandler(Exception.class)
	public R handEx(Exception e){
		e.printStackTrace();
		return R.error( e.getMessage());
	}
}
